﻿using System.ComponentModel;

namespace OpenLightGroup.Common
{
    /// <summary>
    /// Simple object used to create Display/Value objects in XAML
    /// </summary>
    public class ListItem : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged Members

        /// <summary>
        /// Satisfies the INotifyPropertyChanged contract to allow for binding.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        private string _text;

        /// <summary>
        /// Text to associate with the value.
        /// </summary>
        public string Text
        {
            get { return _text; }
            set
            {
                if (_text != value)
                {
                    _text = value;
                    this.PropertyChanged.Raise(this, "Text");
                }
            }
        }


        private object _value;

        /// <summary>
        /// The value to wrap with an associated text label
        /// </summary>
        public object Value
        {
            get { return _value; }
            set
            {
                if (_value != value)
                {
                    _value = value;
                    this.PropertyChanged.Raise(this, "Value");
                }
            }
        }
        
 
    }
}
